home *** CD-ROM | disk | FTP | other *** search
- /* labs.c function, from p.217 of turbo c bible */
- #include<stdio.h>
- #include<stdlib.h>
- main(int argc, char **argv)
- {
- long value , result;
-
- if(argc < 2)
- {
- printf("Usage: <long_integer_value>\n",argv[0]);
- }
- else
- {
- value = atol(argv[1]);
- result = labs(value);
- printf("Absolute value of %ld = %d\n", value, result);
- }
- }